package com.muyu.system.domain.model;

/**
 * @ClassName SysRolePageQueryModel
 * @Author AnNan.Wang
 * @Date 2024/12/16 12:34
 */


import com.muyu.common.core.web.model.QueryModel;
import com.muyu.system.domain.req.SysRoleListReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Date;

/**
 * 参数配置 分页 模型
 */

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysRolePageQueryModel extends QueryModel<SysRolePageQueryModel> {
    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 角色权限
     */
    private String roleKey;
    /**
     * 角色状态（0正常 1停用）
     */
    private String status;
    /**
     * 开始时间
     */
    private Date beginTime;
    /**
     * 结束时间
     */
    private Date endTime;


    public static SysRolePageQueryModel reqBuild(SysRoleListReq sysRoleListReq) {
        SysRolePageQueryModel sysRolePageQueryModel = SysRolePageQueryModel.builder()
                .roleName(sysRoleListReq.getRoleName())
                .roleKey(sysRoleListReq.getRoleKey())
                .status(sysRoleListReq.getStatus())
                .beginTime(sysRoleListReq.getBeginTime())
                .endTime(sysRoleListReq.getEndTime())
                .build();
        sysRolePageQueryModel.domainBuild(sysRoleListReq);
        return sysRolePageQueryModel;
    }
}
